package com.example.springboot.service;

import com.example.springboot.entity.students;
import com.example.springboot.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author bxd
 * @Date 2024-6-15
 **/

@Service
public class StudentService {

    @Autowired
    private StudentMapper studentMapper;

    public List<students> findAll() {
        return studentMapper.findAll();
    }

    public void deleteStu(int student_id) {
        studentMapper.deleteStu(student_id);
    }

    public void addStudent(students students) {
        studentMapper.addStudent(students);
    }

    public void updateStudent(students students){studentMapper.updateStudent(students);}


    public List<students> selectByStudentId(Integer user_id) {
        return studentMapper.selectByStudentId(user_id);
    }

    public List<students> selectByName(String name) {
        return studentMapper.selectByName(name);
    }
}
